import http from "../http";

// export const ZiYuanLieBiaoApi = (): RSP<ZiYuanLieBiao[]> =>
//   http.get(`/resource/listAll`);
// 模糊查询
export const MoHuChaXunApi = (
  params: IQueryUserListParams
): RSP<IUserListResponse<IRoleModel>> => http.get(`/resource/list`, { params });

// 商品分类
export const ShangPinFenLei = (params: any): RSP<any> =>
  http.get(
    `/productCategory/list/${params.parentId}?pageNum=${params.pageNum}&pageSize=${params.pageSize}`
  );

// 修改导航栏状态
export const XiuGaiDaoHangLanApi = (params: any): RSP<number> =>
  http.post(
    `/productCategory/update/navStatus?ids=${params.ids.join(",")}&navStatus=${
      params.navStatus
    }`
  );

// 修改是否显示
export const XiuGaiXianShiApi = (params: any): RSP<number> =>
  http.post(
    `/productCategory/update/showStatus?ids=${params.ids.join(
      ","
    )}&showStatus=${params.showStatus}`
  );

// 商品分类编辑按钮
export const BianJiAnNiuApi = (id: number): RSP<any> =>
  http.get(`/productCategory/${id}`);

// 商品分类删除
export const ShanChuApi = (id: number): RSP<any> =>
  http.post(`/productCategory/delete/${id}`);

// 提交按钮
export const TiJiaoAnNiuApi = (id: number): RSP<any> =>
  http.post(`/productCategory/update/${id}
`);

// 属性管理
export const ShuXinGuanLiApi = (params: any): RSP<any> =>
  http.get(
    `/productAttribute/category/list`,{params}
  );

// 属性列表按钮
export const propertyListApi = (params: any): RSP<any> =>
  http.get(
    `/productAttribute/list/${params.cid}?pageNum=${params.pageNum}&pageSize=${params.pageSize}&type=${params.type}`
  );
// 参数列表按钮
export const productAttributeApi = (params: any): RSP<any> =>
  http.get(
    `/productAttribute/list/${params.cid}?pageNum=${params.pageNum}&pageSize=${params.pageSize}&type=${params.type}`
  );

// 属性管理删除
export const productAttrDelete = (params: any): RSP<any> =>
  http.get(`/productAttribute/category/delete/${params.id}`);
// 属性列表详情页删除
export const PiLiangDelete = (ids: number): RSP<any> =>
  http.post(`/productAttribute/delete?ids=${ids}`);

// 属性管理编辑
export const productAttributeCategoryUpdate = (params: any): RSP<any> =>
  http.post(
    `/productAttribute/category/update/${params.id}?name=${params.name}`
  );
// 修改商品属性信息
export const XiuGaiShangPinShuXinApi = (params: any): RSP<any> =>
  http.post(`/productAttribute/update/${params.id}`, params);
